package com.thoughtworks.conference.utils;

import com.thoughtworks.conference.model.TalkInfo;

import java.util.Comparator;

/**
 * <p>Title: 用于比较talk信息</p>
 * <p>Description:将会议按照耗时倒序排列</p>
 *
 * @author <a href="mailTo:bingxuewulei@outlook.com">wanglei</a>
 * @version 1.0
 * @history: Created by wanglei on  2019/4/23
 */
public class TalkInfloCompare implements Comparator<TalkInfo> {
    @Override
    public int compare(TalkInfo talkInfoArg1, TalkInfo talkInfoArg2) {
        if(null==talkInfoArg1||null==talkInfoArg2){
            return 0;
        }
        if(talkInfoArg1.getTalkTimeIntValue()<talkInfoArg2.getTalkTimeIntValue()){
            return 1;
        }else{
            return -1;
        }
    }

}
